using System;
using System.Collections.Generic;
using Agriculture.Domain;
using MediatR;

namespace Agriculture.Api.Read.Application.Command
{
    /// <summary>
    /// 处方流转订单查询命令
    /// </summary>
    public class PrescriptionOrderQuery : IRequest<PrescriptionOrderQueryResult>
    {
        /// <summary>
        /// 患者姓名或手机号（用于模糊查询）
        /// </summary>
        public string? PatientSearch { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 订单状态（0：全部，1：待支付，2：已完成，3：已失效）
        /// </summary>
        public int? OrderStatus { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 处方流转订单查询结果
    /// </summary>
    public class PrescriptionOrderQueryResult
    {
        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage { get; set; }

        /// <summary>
        /// 处方流转订单列表
        /// </summary>
        public List<PrescriptionOrderDto> PrescriptionOrders { get; set; } = new List<PrescriptionOrderDto>();
    }

    /// <summary>
    /// 处方流转订单DTO
    /// </summary>
    public class PrescriptionOrderDto
    {
        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; }

        /// <summary>
        /// 处方编号
        /// </summary>
        public string PrescriptionNo { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        public string Patient { get; set; }

        /// <summary>
        /// 科室
        /// </summary>
        public string Department { get; set; }

        /// <summary>
        /// 医生
        /// </summary>
        public string Doctor { get; set; }

        /// <summary>
        /// 费用
        /// </summary>
        public decimal Cost { get; set; }

        /// <summary>
        /// 疾病
        /// </summary>
        public string Disease { get; set; }

        /// <summary>
        /// 订单金额
        /// </summary>
        public decimal OrderAmount { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 订单状态（待支付/已完成/已失效）
        /// </summary>
        public string OrderStatus { get; set; }

        /// <summary>
        /// 处方单状态（审核通过/未通过）
        /// </summary>
        public string PrescriptionStatus { get; set; }

        /// <summary>
        /// 购药方式（药店购药/在线配送）
        /// </summary>
        public string PurchaseMethod { get; set; }

        /// <summary>
        /// 发药状态（未核准发药/已核准发药）
        /// </summary>
        public string DispenseStatus { get; set; }
    }
} 